package me.zk.practice1.hw;

import java.util.*;

/**
 * @author zhangkai
 * @date 2023/8/10 17:33
 */
public class HWBJJ24 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n  = Integer.parseInt(scanner.nextLine());

        List<int[]> list = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            int[] nums = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
            int[] times = new int[2];
            times[0] = nums[0];
            times[1] = nums[0] + nums[1];
            list.add(times);
        }
        list.sort((o1, o2) -> {
            if (o1[0] ==o2[0] ) {
                return o1[1] - o2[1];
            }
            return o1[0]-o2[0];
        });
        int[] res = new int[n];
        res[0] = 1;
        int end = list.get(0)[1];
        for (int i = 1; i < list.size(); i++) {
            int s = list.get(i)[0];
            int e = list.get(i)[1];

            if (s-end >=15) {
                res[i] = res[i-1]+1;
                end = e;
            } else {
                res[i] = res[i-1];
                end = Math.min(end,e);
            }

        }
        System.out.println(res[n-1]);


    }
}
